﻿using System;
using System.Collections.Generic;
using System.Text;
using MirrorDrive.Operations;

namespace MirrorDrive.Server.Authorization
{
    public abstract class AuthorizationBase
    {
        public AuthorizationBase()
        {
        }

        public abstract AuthorizationResponse Authorize(string username, string password);

        protected AuthorizationResponse MakeResponse(bool authorized, DriveAccess access, string path)
        {
            return new AuthorizationResponse(authorized, access, path);
        }
    }
    public class AuthorizationResponse
    {
        internal AuthorizationResponse(bool authorized, DriveAccess access, string path)
        {
            this.Authorized = authorized;
            this.Access = access;
            this.AllowedPath = path;
        }

        public bool Authorized { get; private set; }
        public string AllowedPath { get; private set; }
        public DriveAccess Access { get; private set; }
    }
}
